package com.zgjkhis.modules.enums;

import lombok.Getter;

@Getter
public enum WareHousingTypeEnum {
	/**
	 * @Author yzq
	 * @Description 平台采购
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	PTCG(1, "平台采购"),
	/**
	 * @Author yzq
	 * @Description 退货入库
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	THRK(2, "退货入库"),
	/**
	 * @Author yzq
	 * @Description 报溢
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	BY(3, "报溢"),
	/**
	 * @Author yzq
	 * @Description 挑拨入库
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	TBRK(4, "挑拨入库"),
	/**
	 * @Author yzq
	 * @Description 赠品入库
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	ZPRK(5, "赠品入库"),
	/**
	 * @Author yzq
	 * @Description 普通入库
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	PTRK(6, "普通入库"),
	/**
	 * @Author yzq
	 * @Description 盘点入库
	 * @Date 2021/9/14 15:12
	 * @Param
	 * @return
	 **/
	PDRK(7, "盘点入库"),




	;

	private final Integer code;

	private final String value;

	WareHousingTypeEnum(Integer code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String findByCode(Integer code) {
		for (WareHousingTypeEnum drugTypeEnum : WareHousingTypeEnum.values()) {
			if (drugTypeEnum.getCode().equals(code)) {
				return drugTypeEnum.value;
			}
		}
		return "其他";
	}
	public static Integer findByValue(String value) {
		for (WareHousingTypeEnum drugTypeEnum : WareHousingTypeEnum.values()) {
			if (drugTypeEnum.getValue().equals(value)) {
				return drugTypeEnum.code;
			}
		}
		return 2;
	}

}
